package com.dq.repository;

import com.dq.domain.sys.role.SysRole;
import com.dq.domain.sys.role.SysUserRole;
import com.dq.domain.sys.section.SysSection;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @创建人 gewenzhen
 * @创建时间 2019/8/15
 * @描述
 */
public interface SysUserRoleRepository extends JpaRepository<SysUserRole, Long> {
    List<SysUserRole> findBySysUser(SysUser sysUser);
    List<SysUserRole> findByDeletedIsFalseAndSysUser(SysUser sysUser);
    List<SysUserRole> findByDeletedIsFalseAndSysUserAndSysRoleCode(SysUser sysUser, String code);

    List<SysUserRole> findByDeletedIsFalseAndSysUserIdIn(List<Long> userIds);

    List<SysUserRole> findBySysRole(SysRole sysRole);

    List<SysUserRole> findBySysRoleCodeIn(List<String> codes);

    List<SysUserRole> findByDeletedFalseAndSysUserAndSysRoleStatus(SysUser sysUser, SysRole.Status status);

    List<SysUserRole> findBySysUserAndDeletedFalseAndSysRoleDeletedFalse(SysUser sysUser);


    List<SysUserRole> findByDeletedIsFalseAndSysUserSectionAndSysRoleDeletedFalse(SysSection section);


}
